/**
 * 
 */
package org.vidyakiran.app.server.dao;

import java.util.List;

import org.vidyakiran.app.server.domain.entity.VolunteeringActivity;

import com.google.appengine.api.datastore.Key;

/**
 * @author Harpreet
 *
 */
public interface VolunActivityDao {

	/** Saves a new volunteering activity for a given organisation id.
	 * @param orgId The organisation id
	 * @param activity The activity to be created
	 * @return The created activity
	 */
	public VolunteeringActivity saveNewActivityForOrg(Key orgId, VolunteeringActivity activity);
	
	
	/**This method is used for updating an existing activity. Typical usage would involve adding users to the activity.
	 * @param activity The activity to be updated
	 * @return updated activity
	 */
	public VolunteeringActivity updateActivity(VolunteeringActivity activity);
	

	/** Find method to find an activity by its primary key. 
	 * @param id Primary key of the activity
	 * @return The activity object
	 */
	public VolunteeringActivity findActivityById(Key id);
	
	/**This method will find all activities by a name. The search will include the following key points:<br>
	 * 1. Search is case-insensitive.<br>
	 * 2. Search will automatically check for no. of volunteers needed, and how many users are currently attached. If all positions
	 * are filled, then such activities will not be returned.<br>
	 * 3. All the activities fetched would not have the user/organisation objects. All such associations will need to fetched using 
	 * their individual DAO's.<br> 
	 * @param name Activity name to search upon
	 * @return List of activities
	 */
	public List<VolunteeringActivity> findAllActivitiesByName(String name);
}
